package com.scanner.Data;

import com.scanner.hardware.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MSpinnerAdapter extends BaseAdapter{
	
	        String[] mShows;
	        Context  mContext;
	        
	        public MSpinnerAdapter(Context mContext, String[] mShows){
	        	
	            this.mShows   = mShows;
	            this.mContext = mContext;
	        }

			@Override
			public int getCount() {
				return mShows.length;
			}
		
			@Override
			public Object getItem(int position) {
		
				return mShows[position];
			}
		
			@Override
			public long getItemId(int position) {
				return position;
			}
		
			@Override
			public View getView(int position, View convertView, ViewGroup parent) {
			
				if( convertView ==  null){
					convertView  =  LayoutInflater.from(mContext).inflate(R.layout.spinner_item_view, null);
				}
				
				if(convertView != null){
					TextView  mTextView = (TextView)convertView.findViewById(R.id.mtView);
					mTextView.setText(mShows[position]);
				}
		
				return convertView;
			}
	
	
	
	
	
}